#!/bin/bash

##!/bin/bash
#FILENAME=/home/heiko/dummy/packages.txt
#FILESIZE=$(stat -c%s "$FILENAME")
#echo "Size of $FILENAME = $FILESIZE bytes."

# find files and convert them to jpg

for epsfile in `find . -regex ".*[.]eps$"`; do
   len=`expr ${#epsfile} - 4`
   radical=`expr substr $epsfile 1 $len` 
   pdffile=$radical.pdf
   echo "$epsfile -> $pdffile \c"
   ps2pdf -dEPSCrop $epsfile $pdffile
   epssize=$(stat -c%s "$epsfile")   # get file size
   pdfsize=$(stat -c%s "$pdffile")   # get file size 
   echo "   $epssize -> $pdfsize"    # echo file sizes
done
